package com.sright.bcard.content.share.service;

import com.aliyuncs.exceptions.ClientException;
import com.sright.bcard.common.service.share.dto.pager.Pager;
import com.sright.bcard.common.service.share.dto.content.MessageDTO;
import com.sright.common.response.SrightResponse;
import com.taobao.api.ApiException;

import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;

/**
 * 留言service
 */
public interface MessageService {

    /**
     * 获取推荐人姓名
     * @return
     */
    SrightResponse<MessageDTO> referrer(Long memberId);

    /**
     * 申请企业名片
     * @param messageDTO
     * @return
     */
    SrightResponse addMessage(MessageDTO messageDTO) throws ApiException, NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException, ClientException, ParseException;

    MessageDTO getDetailById(Long messageId);

    Pager<MessageDTO> searchByKeyword(String keyword, Integer status,
                                   Integer isOpened,
                                   Integer pageIndex,
                                   Integer pageSize);


    Boolean updateById(Long id, Integer status, String content);

    Boolean updateOpenStatus(Long id, boolean isOpening);
}
